package com.itboye.textileexpes.adapter;

import java.util.ArrayList;

import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.itboye.textileexpres.R;
import com.itboye.textileexpres.widget.TabAdapter;

public class ScrollTabsAdapter extends TabAdapter{
	private Activity activity;

	DisplayMetrics dm;
	ArrayList<Integer> arraylist;

	public ScrollTabsAdapter(Activity activity, ArrayList<Integer> arraylist) {
		super();
		// TODO Auto-generated constructor stub
		this.activity = activity;
		dm = new DisplayMetrics();
		activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
		this.arraylist = arraylist;
	}

	@Override
	public View getView(int position) {
		View v = LayoutInflater.from(activity).inflate(R.layout.luntan_tabs,
				null);
		LinearLayout layout = (LinearLayout) v.findViewById(R.id.tab);
		layout.setPadding(40 , 20,
				40 , 20);
		layout.setPadding(10, 30, 10, 30);

		TextView button = (TextView) v.findViewById(R.id.button);
		
//		button.setWidth(dm.widthPixels / 6);
		button.setText(tabsList.get(position));
		return v;
	}

}
